/*
 * Matrix.h
 *
 *  Created on: 11.04.2012
 *      Author: delgado
 */

#ifndef MATRIX_H_
#define MATRIX_H_

#include <iostream>
using std::ostream;

#include <vector>
using std::vector;

namespace neurignacio{

class Matrix
{
public:
	typedef unsigned char data_t;	// 8-bit number
	typedef unsigned int size_t;
protected:
	data_t** array;
public:
	size_t width;
	size_t height;
public:
	Matrix(const size_t& width, const size_t& height, const data_t& backgroundValue=0);	// Cannot be (const buffer_t& buffer)
	Matrix(const Matrix& matrix);
	Matrix& operator=(const Matrix& matrix);
	~Matrix();
	data_t& operator() (const size_t &x, const size_t &y) {return array[y][x];}
	data_t operator() (const size_t &x, const size_t &y) const {return array[y][x];}
	Matrix transpose(void);
	friend vector<data_t> inner(const Matrix& A, const vector<data_t>& b);
	friend ostream& operator<<(ostream& out, const Matrix& matrix);
};

} // end namespace neurignacio


#endif /* MATRIX_H_ */
